<template>
  <div class="sch_news"> 
    <p>▤招生计划</p>
    <div class="sch_plan_container">
      <div v-for="(m,index) in sch_news_inf" :key="index">
        <a  @click="toSchNews(m._id, m._type, m.school_id)" >{{m.title}}</a>
        <span>{{m.time}}</span>
      </div>
    </div>
  </div>
</template>
<script>
import SchNewsHead from './schnewsitem/SchNewsHead'
export default {
  name:'schnews',
  data(){
    return{
      sch_news_inf:{},
      
    }
  },
  components:{
    
  },
  methods:{
    toSchNews (id, type, school_id) {
      this.$requestByProxy({
        url:`322/news/68009/180665.json`
      }).then(res => {
        console.log(res)
      })
    },
    fetchData () {
      this.$request({
        url:'/sch/news',
        params: {
          name: this.$route.query.name
        }
      }).then(res=>{
        this.sch_news_inf=res.data
        // console.log(res.data)
      }).catch(err=>{
        console.log(err);
      })
    }
  },
  created(){
    this.fetchData()
  },
  watch:{
    '$route': 'fetchData'
  },
  props:{
   school_id1:{
      type:String,
      default:''
    }
  }
}
</script>

<style>
.sch_news{
  width: 1200px;
  border: 1px solid black;
  margin: 10px auto;
}
.sch_news>p{
  font-size: 20px;
  color: rgb(9, 117, 167);
  margin: 10px;
}
.sch_plan_container,.sch_article_container{
  width: 60%;
  margin: 20px;
}
.sch_plan_container>div,.sch_article_container>div{
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  cursor: pointer;
}
.sch_news a:hover{
color: chocolate;
}
</style>